$(document).ready(function(){

	//����ƶ���ȥ��ʱ���6
	$(".searchimg").children("li").hover(function(){
		$(this).addClass('current').end();
		},function(){
		$(this).removeClass('current').end();
	});

	//��������
	$(".searchextend").click(function(){
		if ($(".search-content-left").width()==119)
		{
			$(".search-content-left").animate({width:0},500);
			setTimeout(function(){$(".searchextend").addClass('show-right').css({left:0});},390);
		}
		else {
			$(".search-content-left").animate({width:119},300).end();
			setTimeout(function(){$(".searchextend").css({left:-12}).removeClass('show-right');},200);
		}
	});

	//չ�����
	$(".show-the-year").click( show_hddle_years);

	//selectȡֵ�ж�
	$("#search_area").change(function(){
		var $selectval=$("#search_area option");
		if ($selectval.length-1==$("#search_area").get(0).selectedIndex)
		{
			$(".search-datearea").show();
		}
		else {
			$(".search-datearea").hide();
		}
	});

	//��ҵѡ�񲿷�
	$("#searchcheck-all").click(function(){
		var $company=$(".company").length;
		for (i=0;i<$company ;i++ ){
			$(".company").eq(i).attr("checked",'').parent().removeClass('box-checked');

			$("#searchcheck-all").attr('checked',true).parent().addClass('box-checked');
		}
	});
	$(".company").click(function(){
			$(this).parent().addClass('box-checked');
			$("#searchcheck-all").attr("checked",'').parent().removeClass('box-checked');
	});

	//��ҵ�����
	$(".searchmore").click(function(){
		if ($(".searchcheck").height()==60)
		{	$(".searchmore").addClass("showup").end;
			$(".searchcheck").animate({height:$(".searchcheck ul").height()},500);
			
		}
		else {
			$(".searchcheck").animate({height:60},300);
			$(".searchmore").removeClass('showup');
		}
	});
});



function show_hddle_years(){ 
		if ($(".show-the-year ul").css("display")=="none"){
			$(".show-the-year #show-year-lest").hide();
			$(".show-the-year #hide-year-lest").show();
			$(".show-the-year ul").show(100);
		}
		else {
			$(".show-the-year #show-year-lest").show();
			$(".show-the-year #hide-year-lest").hide();
			$(".show-the-year ul").hide(200);
		} 
}
